﻿@{
    ViewBag.Title = "NatureAdd";
}
@section head
{
    <script src="@Url.Content("~/ScriptPlugin/validate/validate.js")"></script>
    <link href="@Url.Content("~/ScriptPlugin/validate/validate.css")" rel="stylesheet" />
    <script type="text/javascript" src="@Url.Content("~/Scripts/form2json.js")"></script>
    <script type="text/javascript">
    function SaveData(index) {
            if (K.Validate())
            {
                var dto=form2Json();
                K.AjaxJson("@Url.Content("~/Customer/Nature/NatureInsert")",{ dtos: dto }, function (result) {
                    parent.K.layer.callback(index, result, dto);
                    parent.K.layer.close(index);
                });
            }
        }
    </script>
}
<form action="">
    <div class="content-form">
        <table class="content-table">
            <tr>
                <th><span>性质(值)</span></th>
                <td>
                    <input type="text" data-validate-option="isNull" id="Value" name="Value" />
                </td>
                <th>排序号</th>
                <td>
                    <input type="text" style="ime-mode:Disabled" id="Order" value="0" name="Order" onkeypress="KingsSharp.OnlyNum();" />
                </td>
            </tr>
            <tr>
                <th><span>所属性质</span></th>
                <td>
                    <input type="text" id="NatureCatalogName" data-validate-message="所属性质不能为空" data-validate-option="isNull" name="NatureCatalogName" class="p-icon-right p-icon-catalog" readonly="readonly" onclick="getParent()" />
                    <input type="hidden" id="NatureCatalogId" name="NatureCatalogId" />
                </td>
                <th></th>
                <td></td>
            </tr>
            <tr>
                <th>性质说明</th>
                <td colspan="3">
                    <input type="text" id="Description" name="Description" />
                </td>
            </tr>
            <tr>
                <td colspan="4" style="padding:1px 1px 0px 1px;vertical-align:top">
                    <div class="remark">
                        <div>1、所属性质目录一经保存后将无法修改</div>
                    </div>
                </td>
            </tr>
        </table>
    </div>
</form>
@section foot
{
    <script type="text/javascript">
        function getParent()
        {
            K.layer.iframe({
                title: "性质选择",
                initfull: false,
                content: "@Url.Content("~/Customer/Nature/NatureTypeTree")",
                area: ["360px", "335px"],
                callback: function (node) {
                    $("#NatureCatalogName").val(node.name);
                    $("#NatureCatalogId").val(node.id);
                }
            });
        }
    </script>
}